package com.mall.user.controller;

import com.central.common.model.Result;
import com.mall.entity.RolePermission;
import com.mall.user.service.RolePermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rolePermission")
public class RolePermissionController {

    @Autowired
    private RolePermissionService rolePermissionService;

    @PostMapping("/roleAddPermission")
    public Result roleAddPermission(@RequestBody RolePermission rolePermission) {
        int result = rolePermissionService.addPermission(rolePermission);
        if (result > 0) {
            return Result.succeed("添加成功");
        }
        return Result.failed("添加失败");
    }


}
